
public class PrimHeapNode implements Comparable {

	private Vertex vertex;
	
	public PrimHeapNode(Vertex vertex) {
		this.vertex = vertex;
	}
	
	public double getWeight() {
		return ((PrimVertexData) vertex.getData()).getWeight();
	}
	
	public boolean isKnown() {
		return ((PrimVertexData) vertex.getData()).isKnown();
	}
	public void known() {
		((PrimVertexData) vertex.getData()).setKnown();
	}
	
	public void setLabel(String label) {
		((PrimVertexData) vertex.getData()).setLabel(label);
	}
	
	public void setWeight(double weight) {
		((PrimVertexData) vertex.getData()).setWeight(weight);
	}
	
	public void setVertex(Vertex node) {
		((PrimVertexData) vertex.getData()).setVertex(node);
	}
	
	public String toString() {
		return ((PrimVertexData) vertex.getData()).toString();
	}
	
	public String getName() {
		return (String) vertex.getName();
	}
	
	public Vertex vertex() {
		return ((PrimVertexData) vertex.getData()).getVertex();
	}
	
	public int compareTo(Object obj) {
		double weight = getWeight();
		double otherWeight = ((PrimHeapNode) obj).getWeight();
		
		// compare the weights of the edges!
		
		// if less
		if (weight < otherWeight) {
			return -1; 
		}
		// if more
		else if (weight > otherWeight) {
			return 1;
		}
		// if equal
		else
			return 0;
	}

}
